#!/bin/bash

nfs_status=$(systemctl is-active nfs)

if [ $nfs_status == 'inactive' ];then
      systemctl stop keepalived
fi
##!/bin/bash
#count=`netstat -apn | grep 873 | wc -l`
#if [ $count -gt 0 ]; then
#    /usr/bin/systemctl status nfs &>/dev/null
#    if [ $? -ne 0]
#    then
#        /usr/bin/systemctl restart nfs
#        /usr/bin/systemctl status nfs &>/dev/null
#        if [ $? -ne 0]
#        then
#           exit 1
#        fi
#        exit 0
#    fi
#    exit 0
#else
#    exit 1
#fi

